#ifndef _BE_DESIGNER_EVENT_H_
#define _BE_DESIGNER_EVENT_H_

#include <boost\any.hpp>
#include <string>
#include <map>

namespace bd
{
    class Attribute;	
}

namespace bd
{
    enum EventType
	{
        DEFAULT,
		CHECK,
		ON_INIT,
        ON_CHANGE,
        ON_CLICK,
        ON_DBLCLICK,
        ON_ROW_INSERT,
        ON_ROW_REMOVE,
        ON_STREAM_UPLOAD,
        ON_STREAM_DOWNLOAD,
        ON_PANEL_SHOW,
        ON_PANEL_CLOSE,
		ON_KEY_PRESS
    };
    
    class Event
	{
    public:
        Event(EventType type);
        ~Event();
    public:
        Attribute* getTarget() const;
        EventType getEventType() const;
        boost::any* getData() const;
        void setData(boost::any* value);
		std::string getKeyValue();
		void setKeyValue(std::string key);
		void setTarget(Attribute* attri);
		int getKeyCode();
		void setKeyCode(int keyCode);

		std::string errorCode;
		std::string errorMessage;
		std::map<std::string, std::string> infomation;
    protected:
        Attribute *_target;
        EventType _eventType;
        boost::any *_data;
		std::string _keyValue;
		int keyCode;
    };
}

#endif